/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Daniel Cruz
 */
@Entity
@Table(name = "b_login")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BLogin.findAll", query = "SELECT b FROM BLogin b"),
    @NamedQuery(name = "BLogin.findByLogId", query = "SELECT b FROM BLogin b WHERE b.logId = :logId"),
    @NamedQuery(name = "BLogin.findByLogPassword", query = "SELECT b FROM BLogin b WHERE b.logPassword = :logPassword"),
    @NamedQuery(name = "BLogin.findByLogAlias", query = "SELECT b FROM BLogin b WHERE b.logAlias = :logAlias"),
    @NamedQuery(name = "BLogin.findByLogEstado", query = "SELECT b FROM BLogin b WHERE b.logEstado = :logEstado")})
public class BLogin implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "log_id")
    private Long logId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 250)
    @Column(name = "log_password")
    private String logPassword;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 80)
    @Column(name = "log_alias")
    private String logAlias;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 1)
    @Column(name = "log_estado")
    private String logEstado;
    @JoinColumn(name = "prs_identificacion", referencedColumnName = "prs_identificacion")
    @ManyToOne(optional = false)
    private BPersona prsIdentificacion;
    @JoinColumn(name = "per_id", referencedColumnName = "per_id")
    @ManyToOne(optional = false)
    private BPerfil perId;

    public BLogin() {
    }

    public BLogin(Long logId) {
        this.logId = logId;
    }

    public BLogin(Long logId, String logPassword, String logAlias, String logEstado) {
        this.logId = logId;
        this.logPassword = logPassword;
        this.logAlias = logAlias;
        this.logEstado = logEstado;
    }

    public Long getLogId() {
        return logId;
    }

    public void setLogId(Long logId) {
        this.logId = logId;
    }

    public String getLogPassword() {
        return logPassword;
    }

    public void setLogPassword(String logPassword) {
        this.logPassword = logPassword;
    }

    public String getLogAlias() {
        return logAlias;
    }

    public void setLogAlias(String logAlias) {
        this.logAlias = logAlias;
    }

    public String getLogEstado() {
        return logEstado;
    }

    public void setLogEstado(String logEstado) {
        this.logEstado = logEstado;
    }

    public BPersona getPrsIdentificacion() {
        return prsIdentificacion;
    }

    public void setPrsIdentificacion(BPersona prsIdentificacion) {
        this.prsIdentificacion = prsIdentificacion;
    }

    public BPerfil getPerId() {
        return perId;
    }

    public void setPerId(BPerfil perId) {
        this.perId = perId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (logId != null ? logId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BLogin)) {
            return false;
        }
        BLogin other = (BLogin) object;
        if ((this.logId == null && other.logId != null) || (this.logId != null && !this.logId.equals(other.logId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.BLogin[ logId=" + logId + " ]";
    }
    
}
